<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="安装单完工" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doSave(){
		frm.submit();
	}
	function doCancel(){
		if(window.opener){
			window.close();
		}else{
			parent.ClosePop();
		}
	}
	function selectStafferRate(type,idObjId,nameObjId){
		var url="/base/StafferMainForSelect.ihtm?type=MULTI";
		ShowIframe("选择员工",url,800,500,"selectStafferRateCallBack('"+type+"','"+idObjId+"','"+nameObjId+"')",1024,600);	
	}
	function selectStafferRateCallBack(type,idObjId,nameObjId){
		if(popRetVal!=null){
			var idStr="";
			var nameStr="";
			for(i=0;i<popRetVal.length;i++){
				if(idStr!=""){
					idStr=idStr+";";
					nameStr=nameStr+";";
				}
				idStr=idStr+popRetVal[i][0];
				nameStr=nameStr+popRetVal[i][2];
			}
			if(idStr!=""){
				var url="/business/SetStafferRate.ihtm?type="+type+"&id_str="+idStr+"&name_str="+encodeURIComponent(nameStr);
				ShowIframe("设置占比",url,335,250,"selectStafferRateCallBackExt('"+idObjId+"','"+nameObjId+"')");
			}
		}
	}
	function selectStafferRateCallBackExt(idObjId,nameObjId){
		if(popRetVal!=null){
			//var idStr=document.getElementById(idObjId).value;
			//var nameStr=document.getElementById(nameObjId).value;
			var idStr="";
			var nameStr="";
			if(idStr==""){
				idStr=";"+popRetVal[0]+";";
				nameStr=popRetVal[1];
			}else{
				idStr=idStr+popRetVal[0]+";";
				nameStr=nameStr+";"+popRetVal[1];
			}
			document.getElementById(idObjId).value=idStr;
			document.getElementById(nameObjId).value=nameStr;
		}
	}
	function clearStafferRate(idObjId,nameObjId){
		document.getElementById(idObjId).value="";
		document.getElementById(nameObjId).value="";
	}
	function changeTimeSelect(obj,targetName){
		document.getElementById(targetName).value=obj.value;
	}
	function doInit(){
		showFormErrorMsg();
	}
</script>
</head>
<body oncontextmenu="return false" scroll="no" onload="doInit();" class="sheet modal-dialog" style=" padding-top:10px;">
<div class="sheet-main" id="bodyDiv" style="width:470px;">
  <div class="sheet-list" style="width:100%">
    <div class="modal-main search-business">
		<div style="width:100%;">
 			<c:set var="pageTopTitle" value="安装单完工" />
			<%@ include file="../inc/PageTop.jsp"%>
			
			<form name="frm" method="post" enctype="multipart/form-data">
			<table border="0" cellspacing="1" cellpadding="1" align="center" class="table-a">
				<tr>
			      	<th>安装单号：</th>
			      	<td>${command.billCode}</td>
			    </tr>
			    <tr>
			      	<th>派单日期：</th>
			      	<td>${command.billDateStr}</td>
				</tr>
				<tr>
			      	<th>业务单号：</th>
			      	<td>${command.bbCode}</td>
			    </tr>
			    <tr>
			      	<th>客户：</th>
			      	<td>${command.estName}</td>
				</tr>
				<tr>
			      	<th>完工图：</th>
			      	<td>
			      		<div style="position:relative; width:210px; height:28px; overflow:hidden; float:left;">
    						<input type="text" class="TextBox readonly" readonly="readonly" style="width:200px;" name="tmp_att" id="tmp_att">
    					</div>
    					<div style="position:relative;width:40px;height:28px;overflow:hidden;float:left;"> 
							<div style="position:absolute;top:0px;left:0px;width:100%;height:100%;">
								<img class="make-a" src="/images/make-a.gif">
							</div> 
							<input type="file" name="comp_img" id="comp_img" onchange="document.getElementById('tmp_att').value=this.value" style="position:absolute;top:0px;right:0px;cursor:pointer;opacity:0;filter:alpha(opacity:0);z-index:99;">
						</div>
			      	</td>
				</tr>
				<tr>
			      	<th>完工日期：</th>
			      	<td>
			      		<spring:bind path="command.compDateStr">
		                    <input type="text" class="TextBox" style="width:70px;" maxlength="10" id="${status.expression}" name="${status.expression}" value="${status.value}" />
		                    <img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('compDateStr'),'yyyy-mm-dd',document.getElementById('compDateStr'));">
		                    <select id="billDateHourSelect" class="ddlDateHour" onChange="changeTimeSelect(this,'compDateHour');">
		                        <c:forEach var="item" begin="0" step="1" end="23" varStatus="i"><c:if test="${i.index<10}"><c:set var="item" value="0${item}" /></c:if><option value="${item}" <c:if test="${item==command.compDateHour}">selected</c:if>>${item}</option></c:forEach>
		                    </select>
		                    <select id="billDateMinuteSelect" class="ddlDateMinute" onChange="changeTimeSelect(this,'compDateMinu');">
		                        <c:forEach var="item" begin="0" step="1" end="59" varStatus="i"><c:if test="${i.index<10}"><c:set var="item" value="0${item}" /></c:if><option value="${item}" <c:if test="${item==command.compDateMinu}">selected</c:if>>${item}</option></c:forEach>
		                    </select>
		                </spring:bind>
			      	</td>
				</tr>
				<tr>
			      	<th>安装人员：</th>
			      	<td>
			      		<spring:bind path="command.setuNameStr">
        				<input type="text" class="tbInfo2 TextBox readonly" readOnly="true" id="${status.expression}" name="${status.expression}" value="${status.value}" onmouseover="this.title=this.value" />
        				<img src="/images/make-a.gif" class="imgIconButton" onClick="selectStafferRate('SETUP','setuIdStr','setuNameStr');" title="选择安装员，用于计算该员工的安装产值" />
        				<img src="/images/icon_del.gif" class="imgIconButton" onClick="clearStafferRate('setuIdStr','setuNameStr');">
    					</spring:bind>
    					<spring:bind path="command.setuIdStr">
        					<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
    					</spring:bind>
			      	</td>
				</tr>
				<tr>
			      	<th>工程金额：</th>
			      	<td>
			      		<spring:bind path="command.costStr">
        				<input type="text" class="tbInfo2 TextBox" maxlength="10" id="${status.expression}" name="${status.expression}" value="${status.value}">
    					</spring:bind>
			      	</td>
				</tr>
			</table>		
			<spring:bind path="command.compDateHour"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
			<spring:bind path="command.compDateMinu"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
			</form>
		</div>
  	</div>
  </div>
	<div class="modal-buttom">
		<input type="button" class="buttom-a" value="完 工" onClick="doSave();">
		<input type="button" class="buttom-a" value="取 消" onClick="doCancel();">
	</div>  
</div>

</body>
</html>
